package com.luckymore.ydd.app.model;

import com.base.model.Bean2Json;

import org.json.JSONArray;

import java.util.ArrayList;
import java.util.List;

public class MSystem {

	static public class MRet extends Bean2Json<MRet> {
		private static final long serialVersionUID = 1L;
		private int code;
		private String msg;
		private String img;
		public int getCode() {
			return this.code;
		}
		public void setCode(int code) {
			this.code=code;
		}
		public String getMsg() {
			return this.msg;
		}
		public void setMsg(String msg) {
			this.msg=msg;
		}
		public String getImg() {
			return this.img;
		}
		public void setImg(String img) {
			this.img=img;
		}
		public MRet build() throws Exception {
			this.setCode(data.getInt("code_"));
			this.setMsg(data.getString("msg_"));
			this.setImg(data.getString("img_"));
			return this;
		}
		public void build(Bean2Json data) {
			this.setCode(((MRet)data).getCode());
			this.setMsg(((MRet)data).getMsg());
			this.setImg(((MRet)data).getImg());
		}

	}

    static public class MVersionCheck extends Bean2Json<MVersionCheck> {
        private static final long serialVersionUID = 1L;
        private String id;
        private String version;
        private String url;
        private String desc;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getVersion() {
            return version;
        }

        public void setVersion(String version) {
            this.version = version;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public MVersionCheck build() throws Exception {
            this.setId(data.getString("id_"));
            this.setUrl(data.getString("url_"));
            this.setDesc(data.getString("desc_"));
            this.setVersion(data.getString("version_"));
            return this;
        }
        public void build(Bean2Json data) {
            this.setId(((MVersionCheck)data).getId());
            this.setUrl(((MVersionCheck)data).getUrl());
            this.setDesc(((MVersionCheck)data).getDesc());
            this.setVersion(((MVersionCheck)data).getVersion());
        }

    }

    static public class MIndexs extends Bean2Json<MIndexs> {
        private static final long serialVersionUID = 1L;
        private List<MIndex> list = new ArrayList<>();
        public List<MIndex> getList() {
            return this.list;
        }
        public void setList(List<MIndex> list) {
            this.list=list;
        }
        public MIndexs build() throws Exception {
            JSONArray jalist = data.getJSONArray("index_");
            for(int i = 0, len = jalist.length(); i < len; i++) {
                MIndex n = new MIndex();n.setData(jalist.getJSONObject(i));this.list.add(n);
            }
            return this;
        }
        public void build(Bean2Json data) {
            this.setList(((MIndexs)data).getList());
        }

    }

    static public class MIndex extends Bean2Json<MIndex> {
        private static final long serialVersionUID = 1L;
        private int dayLeft;
        private String content;
        private String img;
        private String imgZj;
        private String imgGn;
        private String imgGn3;
        private int days;
        private int isSigned;
        private String diary;

        public int getDayLeft() {
            return dayLeft;
        }

        public void setDayLeft(int dayLeft) {
            this.dayLeft = dayLeft;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getImgZj() {
            return imgZj;
        }

        public void setImgZj(String imgZj) {
            this.imgZj = imgZj;
        }

        public String getImgGn() {
            return imgGn;
        }

        public void setImgGn(String imgGn) {
            this.imgGn = imgGn;
        }

        public int getDays() {
            return days;
        }

        public void setDays(int days) {
            this.days = days;
        }

        public String getImgGn3() {
            return imgGn3;
        }

        public void setImgGn3(String imgGn3) {
            this.imgGn3 = imgGn3;
        }

        public int getIsSigned() {
            return isSigned;
        }

        public void setIsSigned(int isSigned) {
            this.isSigned = isSigned;
        }

        public String getDiary() {
            return diary;
        }

        public void setDiary(String diary) {
            this.diary = diary;
        }

        public String getImg() {
            return this.img;
        }
        public void setImg(String img) {
            this.img=img;
        }
        public MIndex build() throws Exception {
            this.setDays(data.getInt("days_"));
            this.setDayLeft(data.getInt("daysLeft_"));
            this.setContent(data.getString("content_"));
            this.setImg(data.getString("img_"));
            this.setImgGn(data.getString("imgGn_"));
            this.setImgGn3(data.getString("imgGn2_"));
            this.setImgZj(data.getString("imgZj_"));
            this.setIsSigned(data.getInt("isSigned_"));
            this.setDiary(data.getString("diary_"));
            return this;
        }
        public void build(Bean2Json data) {
            this.setDayLeft(((MIndex) data).getDayLeft());
            this.setDays(((MIndex) data).getDays());
            this.setContent(((MIndex) data).getContent());
            this.setImg(((MIndex)data).getImg());
            this.setImgGn(((MIndex) data).getImgGn());
            this.setImgGn3(((MIndex) data).getImgGn3());
            this.setImgZj(((MIndex) data).getImgZj());
            this.setIsSigned(((MIndex) data).getIsSigned());
            this.setDiary(((MIndex) data).getDiary());
        }

    }

	static public class MImg extends Bean2Json<MImg> {
		private static final long serialVersionUID = 1L;
		private String img;
		public String getImg() {
			return this.img;
		}
		public void setImg(String img) {
			this.img=img;
		}
		public MImg build() throws Exception {
			return this;
		}
		public void build(Bean2Json data) {
			this.setImg(((MImg)data).getImg());
		}

	}


}
